#!bin/sh
test_result='GOOD'
for file in ./testset/YIN/*
do
    #执行该测试文件
    # echo $file
    ./a_test.out $file
    #将程序输出与标准文件比对
    echo 
    echo "文件比对"
    outfile=${file/YIN/YOUT}
    testfile=${file/YIN/YTEST}

    # echo "outfile:"$outfile
    # echo "testfile:"$testfile

    if ! cmp -s $outfile $testfile
    then
        echo "BAD"
        test_result='BAD'
    else
        echo "GOOD"
    fi

    echo "----------------------"
done

echo "测试结果："$test_result